#pragma once

#include "SubroutinePopulation.h"
#include "Population.h"

class SymbioticInterface
	{

	protected:
		void destroy( );

	protected:
		vector< Token::pointer (*) ( const Token& )>* BlockPopulation_FormationRules;
		bool (*StemCellRecognizer) ( const Token& );
		const PopulationParameters*	BlockPopulationParameters;

	public:
		TokenSet*										Genes;
		TermSet*										BlockPopulation;
		map<const Token*, size_t> 				BlockUseStats;
		vector<VirtualInvertedListTerm*>*	StemCells;
		Population*									CDNAStatementPopulation;

	public:
		SymbioticInterface(TokenSet*);
		~SymbioticInterface(void);

	public:
		//void cleanBlockPopulation(void (*)( void ));
		void fillBlockPopulation(void (*)( void ));
		void cleanBlockPopulation(void (*)( void ));

		void generateInitialBlockPopulation( 
			PopulationParameters*,					//from Population.h
			bool (*) ( const Token&),				//Predicate, indicates that Token can be used as the root of the tree						
			vector< Token::pointer (*) (const Token&)>*,		//Rules of formation
			void (*)( )=NULL); 					//Ticker

			
		void generateCDNAStatementPopulation( 
			PopulationParameters*, 
			const Type*,
			void (*)( )=NULL);

	};

